const delRepeat = (arr)=> {
  let temp = arr[0]
  let len = 1
  for(let i=1; i< arr.length; i++) {
    if(temp != arr[i]) {
      arr[len] = arr[i]
      temp = arr[i]
      len++
    }
  }
  return arr.slice(0, len+1)
}
console.log(delRepeat([0,2,3,3,4,4,4,5,5,6,6,7,7,8,8,8,8,9,9,9]))

// var removeDuplicates = function(nums) {
//   let lowIndex = 1
//   let temp = nums[lowIndex]
//   for(let i=1; i< nums.length; i++) {
//       if(nums[i] === temp) {

//       }else{
//           nums[lowIndex] = nums[i]
//           temp = nums[i]
//           lowIndex++
//       }
//   }
//   return lowIndex
// };